page.tsx 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. import { notFound } from "next/navigation";
  2. import secondselfShot from "@/assets/projects/secondself.webp";
  3. import { BentoGrid, type BentoItem } from "@/components/bento/bento-grid";
  4. import { ArtifactsCard } from "@/components/cards/artifacts";
  5. import { EmojiCard } from "@/components/cards/emoji";
  6. import { FinOpsCard } from "@/components/cards/finops";
  7. import { GlobeCard } from "@/components/cards/globe";
  8. import { HeroCard } from "@/components/cards/hero";
  9. import { MiniCard } from "@/components/cards/mini-card";
  10. import { PackBookCard } from "@/components/cards/packbook";
  11. import { PhotoDeck } from "@/components/cards/photo-deck";
  12. import { ProjectCard } from "@/components/cards/project";
  13. import { SkyCard } from "@/components/cards/sky";
  14. import { TechSphere } from "@/components/cards/tech-sphere";
  15. import { WritingCard, type PostSummary } from "@/components/cards/writing";
  16. import { projects } from "@/config/site";
  17. import { getHomeData } from "@/lib/data";
  18. import { isLocale } from "@/lib/i18n";
  19. import { getMessages } from "@/messages";
  20. // Static, refreshed hourly: the Firebase image URLs are baked in.
  21. export const revalidate = 3600;
  22. export default async function Page({
  23. params,
  24. }: {
  25. params: Promise<{ lang: string }>;
  26. }) {
  27. const { lang } = await params;
  28. if (!isLocale(lang)) notFound();
  29. const t = getMessages(lang);
  30. const home = await getHomeData();
  31. // Articles are emptied for now: no Notion request and no post list. The
  32. // pipeline stays in lib/notion.ts for when they come back.
  33. const posts: PostSummary[] = [];
  34. // A project's name and link from the config, its words in this language.
  35. const project = (id: keyof typeof projects) => ({
  36. ...projects[id],
  37. ...t.projects[id],
  38. });
  39. // Order matters: cards pack first-fit in this order. Sizes are columns × rows
  40. // on phones (2 columns, below the hero's header row), wide phones (2), small
  41. // tablets (2), tablets (3), and desktops (4).
  42. // On tablets:
  43. // [hero ][sky ]
  44. // [hero ][globe]
  45. // [finops ]
  46. // [artifacts ]
  47. // [secondself][pack ]
  48. // [photos ][pack ]
  49. // [photos ][web ]
  50. // [chatbot ][web ]
  51. // [tech][mini][emoji]
  52. // [paper][writing ]
  53. // On desktop:
  54. // [hero ][finops ]
  55. // [hero ][artifacts ]
  56. // [sky][globe][secondself]
  57. // [pack][photos ][web]
  58. // [pack][photos ][web]
  59. // [chatbot ][tech][mini]
  60. // [emoji][paper][writing ]
  61. // Cards 1 / 2 / 4 are blank placeholders for now. Their components and the
  62. // original JSX stay right here; flip a flag to true to bring one back.
  63. const show = {
  64. finops: false,
  65. artifacts: false,
  66. secondself: false,
  67. writing: false,
  68. packbook: false,
  69. photos: true,
  70. chatbot: false,
  71. emoji: false,
  72. paper: false,
  73. };
  74. const items: BentoItem[] = [
  75. {
  76. id: "hero",
  77. tags: ["about"],
  78. label: t.cards.hero,
  79. size: [
  80. [2, 1],
  81. [2, 2],
  82. [2, 2],
  83. [2, 2],
  84. [2, 2],
  85. ],
  86. still: true,
  87. // Below 768px a full-width header row as tall as its content (the first
  88. // three sizes go unused).
  89. header: true,
  90. content: (
  91. <HeroCard avatarUrl={home.avatarUrl} dogUrl={home.dogUrl} lang={lang} />
  92. ),
  93. },
  94. {
  95. id: "finops",
  96. tags: ["work"],
  97. label: "AWS FinOps Agent",
  98. size: [
  99. [2, 2],
  100. [2, 2],
  101. [2, 1],
  102. [3, 1],
  103. [2, 1],
  104. ],
  105. content: show.finops ? <FinOpsCard /> : null,
  106. },
  107. {
  108. id: "artifacts",
  109. tags: ["work"],
  110. label: "Amazon Q artifacts",
  111. size: [
  112. [2, 2],
  113. [2, 2],
  114. [2, 1],
  115. [3, 1],
  116. [2, 1],
  117. ],
  118. content: show.artifacts ? <ArtifactsCard /> : null,
  119. },
  120. {
  121. id: "sky",
  122. tags: ["about"],
  123. label: t.cards.sky,
  124. size: [
  125. [1, 1],
  126. [1, 1],
  127. [1, 1],
  128. [1, 1],
  129. [1, 1],
  130. ],
  131. content: <SkyCard />,
  132. },
  133. {
  134. id: "globe",
  135. tags: ["about"],
  136. label: t.cards.globe,
  137. size: [
  138. [1, 1],
  139. [1, 1],
  140. [1, 1],
  141. [1, 1],
  142. [1, 1],
  143. ],
  144. content: <GlobeCard />,
  145. },
  146. {
  147. id: "secondself",
  148. tags: ["work"],
  149. label: projects.secondself.name,
  150. size: [
  151. [2, 1],
  152. [2, 1],
  153. [2, 1],
  154. [2, 1],
  155. [2, 1],
  156. ],
  157. content: show.secondself ? (
  158. <ProjectCard
  159. image={secondselfShot}
  160. look="secondself"
  161. lang={lang}
  162. project={project("secondself")}
  163. />
  164. ) : null,
  165. },
  166. {
  167. id: "packbook",
  168. tags: ["work"],
  169. label: "PackBook",
  170. size: [
  171. [2, 2],
  172. [2, 2],
  173. [1, 2],
  174. [1, 2],
  175. [1, 2],
  176. ],
  177. content: show.packbook ? <PackBookCard /> : null,
  178. },
  179. {
  180. id: "photos",
  181. tags: ["about"],
  182. label: t.cards.photos,
  183. size: [
  184. [2, 2],
  185. [2, 2],
  186. [2, 2],
  187. [2, 2],
  188. [2, 2],
  189. ],
  190. content: show.photos ? <PhotoDeck photos={home.photos} /> : null,
  191. },
  192. {
  193. id: "webagent",
  194. tags: ["work"],
  195. label: projects.webagent.name,
  196. size: [
  197. [1, 2],
  198. [1, 2],
  199. [1, 2],
  200. [1, 2],
  201. [1, 2],
  202. ],
  203. content: (
  204. <ProjectCard
  205. height={800}
  206. image={home.webagentUrl}
  207. lang={lang}
  208. link={false}
  209. look="webagent"
  210. project={project("webagent")}
  211. width={1000}
  212. />
  213. ),
  214. },
  215. {
  216. id: "chatbot",
  217. tags: ["work"],
  218. label: projects.chatbot.name,
  219. size: [
  220. [2, 1],
  221. [2, 1],
  222. [2, 1],
  223. [2, 1],
  224. [2, 1],
  225. ],
  226. content: show.chatbot ? (
  227. <ProjectCard
  228. height={1280}
  229. image={home.chatbotUrl}
  230. look="chatbot"
  231. lang={lang}
  232. project={project("chatbot")}
  233. width={2629}
  234. />
  235. ) : null,
  236. },
  237. {
  238. id: "tech",
  239. tags: ["about", "work"],
  240. label: t.cards.tech,
  241. size: [
  242. [1, 1],
  243. [1, 1],
  244. [1, 1],
  245. [1, 1],
  246. [1, 1],
  247. ],
  248. content: <TechSphere />,
  249. },
  250. {
  251. id: "mini",
  252. tags: ["about"],
  253. label: t.cards.mini,
  254. size: [
  255. [1, 1],
  256. [1, 1],
  257. [1, 1],
  258. [1, 1],
  259. [1, 1],
  260. ],
  261. content: <MiniCard />,
  262. },
  263. {
  264. id: "emoji",
  265. tags: ["work"],
  266. label: t.cards.emoji,
  267. size: [
  268. [1, 1],
  269. [1, 1],
  270. [1, 1],
  271. [1, 1],
  272. [1, 1],
  273. ],
  274. content: show.emoji ? <EmojiCard /> : null,
  275. },
  276. {
  277. id: "paper",
  278. tags: ["work"],
  279. label: projects.paper.name,
  280. size: [
  281. [1, 1],
  282. [1, 1],
  283. [1, 1],
  284. [1, 1],
  285. [1, 1],
  286. ],
  287. content: show.paper ? (
  288. <ProjectCard
  289. height={1280}
  290. image={home.paperUrl}
  291. look="paper"
  292. lang={lang}
  293. project={project("paper")}
  294. width={1577}
  295. />
  296. ) : null,
  297. },
  298. {
  299. id: "writing",
  300. tags: ["about"],
  301. label: t.cards.writing,
  302. size: [
  303. [2, 2],
  304. [2, 2],
  305. [2, 1],
  306. [2, 1],
  307. [2, 1],
  308. ],
  309. content: show.writing ? (
  310. <WritingCard lang={lang} posts={posts} />
  311. ) : null,
  312. },
  313. ];
  314. return <BentoGrid items={items} />;
  315. }